package com.hnevc.thread;

class CaculateThread1 extends Thread{
	@Override
	public void run() {
		int sum =0;
		for(int i=1;i<=100000;i++){
			sum += i;
			System.out.println(sum+"sum1");
		}
		System.out.println(sum);
	}
}
class CaculateThread2 extends Thread{
	@Override
	public void run() {
		int sum =0;
		for(int i=100000;i<=200000;i++){
			sum += i;
			System.out.println(sum+"sum2");
		}
		System.out.println(sum);
	}
}
public class ThreadDemoTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		CaculateThread1 thread1 = new CaculateThread1();
		CaculateThread2 thread2 = new CaculateThread2();
		thread1.start();
		thread2.start();
		

	}

}
